﻿Public Class CTPartidaSolicitud


Private _AncestroPS             As long
Private _PartidaSolId           As Long
Private _SecSol                 As Long
Private _TvngId                 As Byte
Private _Tvng                   As String 'Solo Lectura, se carga en automático cuando se asigna el valor _TvngID
Private _FecSol                 As Date
Private _FecLiq                 As Date
Private _FecPlazo               As Date
Private _CantidadSol            As Decimal
Private _Comentarios            As string 
Private _TipoCantidadId         As enumTipoCantidad
Private _TipoCantidad           As String
Private _EstatusActualPS        As enumEstatusPS
Private _Estatus                As String
Private _CantidadActualPS       As Decimal
Private _TipoPartida            As String
Private _Plazo                  As Long
Private _IntermFlexibles        As Long
Private _FolioEnviadoDecalog    As Long
Private _Agrupador              As String

Private _lstPEJ                 As List(Of CTPartidaEJ) 

Private _SeleccionEJ            As Boolean
Private _SeleccionSol           As Boolean
Private _CatalogoTVNgID         As Integer = 5
Private _CatalogoTipoCantidadID As Integer = 4
Private _CatalogoEstatusID      As Integer = 9

Public Enum enumEstatusPS
 NO_ASIGNADA        = 0  ' Estatus inicial
 CREADA             = 1
 ENVIADA            = 2
 EN_PROCESO         = 3
 LIBERADA           = 4
 EN_DISTRIBUCION    = 5
 CERRADA            = 6
 CANCELADA          = 7
 CANCELADA_ACEPTADA = 8
 CERRADA_INCOMPLETA = 9
End Enum

Public Enum enumTipoCantidad 

   EFECTIVO = 1
   TITULOS  = 2    

End Enum



Public Sub new () 
   
   _EstatusActualPS   = enumEstatusPS.NO_ASIGNADA 
   _CantidadActualPS  = 0.0     
   _lstPEJ            = New List(Of CTPartidaEJ)  
     
   '(Implementar)
   '_Tvng = ""
   '_TipoCantidad  = ""


End Sub

#Region "Porpiedades de la clase"

Public Property AncestroPS() As Long
    Get
         Return _AncestroPS 
    End Get    
    Set (ByVal value As Long)
        _AncestroPS = value
    End Set
End Property

Public Property PartidaSolId() As Long
    Get
        Return _PartidaSolId 
    End Get     
    Set(ByVal value As Long)     
        _PartidaSolId = value
    End Set
End Property

Public Property SecSol() As Long
    Get
        Return _SecSol
    End Get
    Set(ByVal value As Long)
        _SecSol = value
    End Set
End Property

Public Property TvngId() As Byte
    Get
        Return _TvngId
    End Get
    Set(ByVal value As Byte)
        _TvngId = value
    End Set
End Property

Public Property Tvng() As String
    Get
        Return _Tvng
    End Get
    Set(ByVal value As String)
        _Tvng = value
    End Set
End Property

Public Property FecSol() As date
    Get
        Return _FecSol 
    End Get
    Set(ByVal value As date)
        _FecSol = value
    End Set
End Property

Public Property FecLiq() As date
    Get
        Return _FecLiq 
    End Get
    Set(ByVal value As date)
        _FecLiq = value
    End Set
End Property

Public Property FecPlazo() As date
    Get
        Return _FecPlazo 
    End Get
    Set(ByVal value As date)
        _FecPlazo = value
    End Set
End Property

Public Property CantidadSol() As decimal
    Get
        Return _CantidadSol 
    End Get
    Set(ByVal value As decimal)
        _CantidadSol = value
    End Set
End Property

Public Property Comentarios() As String
    Get
        Return _Comentarios 
    End Get
    Set(ByVal value As String)
        _Comentarios = value
    End Set
End Property

Public  Property TipoCantidadId() As enumTipoCantidad
    Get
        Return _TipoCantidadId 
    End Get
    Set(ByVal value As enumTipoCantidad)
        _TipoCantidadId = value
        _TipoCantidad = "MX" 'ejemplo
    End Set
End Property

Public ReadOnly Property TipoCantidad() As String
    Get
        Return _TipoCantidad 
    End Get
    
End Property


Public Property LstPEJ() As List(Of CTPartidaEJ)
    Get
        Return _lstPEJ
    End Get
    Set(ByVal value As List(Of CTPartidaEJ))
        _lstPEJ = value
    End Set
End Property



Public Property EstatusActualPS () As enumEstatusPS
    Get
        Return _EstatusActualPS  
    End Get
    Set(ByVal value As enumEstatusPS)
        _EstatusActualPS  = value
    End Set
End Property

Public Property Estatus() As String
    Get
        Return _Estatus
    End Get
    Set(ByVal value As String)
        _Estatus = value
    End Set
End Property

Public Property CantidadActualPS() As Decimal
    Get
        Return _CantidadActualPS
    End Get
    Set(ByVal value As Decimal)
        _CantidadActualPS = value
    End Set
End Property

Public Property TipoPartida() As String
    Get
        Return _TipoPartida
    End Get
    Set(ByVal value As String)
        _TipoPartida = value
    End Set
End Property




Public Property SeleccionEJ() As Boolean
    Get
        Return _SeleccionEJ 
    End Get
    Set(ByVal value As Boolean)
        _SeleccionEJ = value
    End Set
End Property

Public Property SeleccionSol() As Boolean
    Get
        Return _SeleccionSol
    End Get
    Set(ByVal value As Boolean)
        _SeleccionSol = value
        'NotificarCambio("SeleccionSol")
    End Set
End Property

Public Property Plazo() As Long
    Get
        Return _Plazo
    End Get
    Set(ByVal value As Long)
        _Plazo = value
    End Set
End Property

Public Property Agrupador() As String
    Get
        Return _Agrupador
    End Get
    Set(ByVal value As String)
        _Agrupador = value
    End Set
End Property

Public ReadOnly Property CatalogoTVNgID() As Integer

    Get
        Return _CatalogoTVNgID
    End Get

End Property

Public ReadOnly Property CatalogoTipoCantidadID() As Integer

    Get
        Return _CatalogoTipoCantidadID
    End Get

End Property

Public ReadOnly Property CatalogoEstatusID() As Integer

    Get
        Return _CatalogoEstatusID
    End Get

End Property

Public Property IntermFlexibles() As Long
    Get
        Return _IntermFlexibles
    End Get
    Set(ByVal value As Long)
        _IntermFlexibles = value
    End Set
End Property

Public Property FolioEnviadoDecalog() As Long
    Get
        Return _FolioEnviadoDecalog
    End Get
    Set(ByVal value As Long)
        _FolioEnviadoDecalog = value
    End Set
End Property

Public Overrides Function ToString() As String

        Return "idPS:" & _PartidaSolId.ToString() & ",Estatus:" & _EstatusActualPS & ",Tvng:" & _TvngId & ",FecSol:" & _FecSol.ToString() _
                & ",FecLiq:" & _FecLiq.ToString() & ",FecPlazo:" & _FecPlazo.ToString() & ",CantidadSol:" & _CantidadSol.ToString() _
                & ",Plazo" & _Plazo.ToString()
End Function

#End Region




#Region "Administración de Partidas de Ejecución PEJ"




    Public Function AgregarPEJ(Byref pPEJ As CTPartidaEJ) As Boolean
         
              

            Return True 
    End Function

    Public Function GuardarPEJ(ByRef pPEJId As long) As Boolean      
         Return true
    End Function

    Public Function EliminarPEJ(ByVal pPEJId As Long) As Boolean
      Return True 
    End Function
    
    Public Function GuardarLotePEJ(ByRef pLstPEJId As List(Of Long)) As Boolean      
      Return true
    End Function
 
    Public Function EliminarlotePEJ(ByVal plstPEJId As List(Of Long)) As Boolean
      Return true
    End Function

    Public Function ConfirmarPEJ(ByVal pPEJId As Long) As Boolean

        ' se establece el estatus de la PEJ, lista para distribuir

       Return True
    End Function

    Public Function ConfirmarLotePEJ(ByRef pLstPEJId As List(Of Long)) As Boolean
       Return 0 
    End Function
        
    


#End Region








End Class
